package com.shuma.user.controller;


import com.shuma.common.vo.R;
import com.shuma.common.vo.req.LoginReq;
import com.shuma.user.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@CrossOrigin
public class UserController {

    @GetMapping("/hello")
    public String hello() {
//        StpUtil.checkRole("admin1");
        return "hello world!";
    }

    @Autowired
    private UserService userService;

    @PostMapping("/login")
    public R login(@RequestBody LoginReq loginReq) {
        return userService.login(loginReq);
    }
}
